package com.xj.proxy.jdkProxy;

import com.xj.proxy.staticProxy.MathSub;
import com.xj.proxy.staticProxy.Subject;

import java.lang.reflect.Proxy;

/**
 * @author: xujiang
 * @createTime: 2021/8/18 12:48:54
 */
public class Test {

    public static void main(String[] args) {
        MathSub mathSub = new MathSub();
        ProxyHandler handler = new ProxyHandler(mathSub);
        Subject subject = (Subject) Proxy.newProxyInstance(mathSub.getClass().getClassLoader(), mathSub.getClass().getInterfaces(), handler);
        subject.request();
    }
}
